<?php
include  '../loginCheck.php';
include  '../Util.php';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <title>News</title>
        <link rel="stylesheet" type="text/css" href="view.css" media="all"/>
        <script type="text/javascript" src="view.js"></script>
        <script type="text/javascript" src="calendar.js"></script>
    </head>
    <body id="main_body" >

        <img id="top" src="top.png" alt=""/>
        <div id="form_container">

            <h1>
                <?php
                include  'menu.php';
                ?>
            </h1>
            <form id="form_144190" class="appnitro"  method="post" action="../adminResolveNews.php">
                <div class="form_description">
                    <h2><a href ="news.php"> News</a> | <a href ="newsEdit.php">Edit News</a> | Delete News</h2>
                    <p>You are deleting news.</p>
                </div>
                <ul >

                    <li id="li_1" >

                        <label class="description" for="element_1">News </label>
                        <span>
                            <?php

                            $link = Util::getLink();

                            $query = sprintf(Util::$select_jornakDestination,
                                mysql_real_escape_string("1")
                            );

                            $result = mysql_query($query);

                            if (!$result) {
                                die('Could not query:' . mysql_error() . '<br>' . $query);
                            }
                            $i = 1;
                            while ($row = mysql_fetch_assoc($result)) {
                                $query = sprintf(Util::$select_jornakText,
                                    mysql_real_escape_string($row['textid'])
                                );
                                $result2 = mysql_query($query);
                                if (!$result2) {
                                    die('Could not query:' . mysql_error() . '<br>' . $query);
                                }
                                $row2 = mysql_fetch_assoc($result2);
                                echo '<input id="element_1_'.$i.'" name="element_1_'.$i.'" class="element checkbox" type="checkbox" value="'.$row['id'].'" />';
                                echo '<label class="choice" for="element_1_'.$i.'">'.$row2['header'].'</label>';
                                $i++;
                            }
                            echo '<input type="hidden" name="count" value="'.$i.'" />';
                            Util::closeLink($link);

                            ?>
                        </span>
                    </li>

                    <li class="buttons">
                        <input type="hidden" name="form_id" value="144190" />
                        <input type="hidden" name="delete" value="true" />

                        <input id="saveForm" class="button_text" type="submit" name="submit" value="Delete selected" />
                    </li>
                </ul>
                <input type="hidden" name="form_type" value="1" />
            </form>
            <div id="footer">

            </div>
        </div>
        <img id="bottom" src="bottom.png" alt=""/>
    </body>
</html>